import os

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

from settings import *

class MainPage(webapp.RequestHandler):
  def get(self):
    self.response.headers['Content-Type'] = 'text/html'
    self.response.out.write('<h1>Michael\'s RSS to KINDLE delivery demo app</h1>\n')
    self.response.out.write('<p>This App delivers blog headlines and summaries to Michael\'s Kindle once a day via the Kindle email-to-content feature.</p>\n')
    self.response.out.write('<p>Current RSS Feed is <a href="' + RSS_FEED + '">here</a>.<br />')
    self.response.out.write('My sender email address is: ')
    self.response.out.write(" ".join(SENDER_EMAIL) + '<br />')
    self.response.out.write('My kindle\'s email address is: ')
    self.response.out.write(" ".join(KINDLE_EMAIL) + '</p>')


application = webapp.WSGIApplication([('/', MainPage)],
                                     debug=True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()